package com.yr.ryjk.expert.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import com.yr.ryjk.expert.entity.DoctorExpert;

public interface DoctorExpertMapper {
    int deleteByPrimaryKey(String id);

    int insert(DoctorExpert record);

    int insertSelective(DoctorExpert record);

    DoctorExpert selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(DoctorExpert record);

    int updateByPrimaryKey(DoctorExpert record);
    
    
    @ResultMap("BaseResultMap")
    @Select("select * from doctor_expert where doc_id = #{0}")
    List<DoctorExpert> selectByDoctorId(String id);
    
    @Select("select * from doctor_expert where expert_type_id = #{2} limit #{0},#{1}")
    @ResultMap("BaseResultMap")
    List<DoctorExpert> selectByDoctorExpertTpyeId(int pageNo, int pageSize,String typeId);

    @Delete("delete from doctor_expert where expert_type_id=#{0} and find_in_set(doc_id,#{1})")
	void deletePopDoc(String typeId, String docIds);

    @Delete("delete from doctor_expert where find_in_set(expert_type_id,#{0})")
	void deleteByTypeIds(String ids);
}